import service from "../utils/request";
import ajax from '@/utils/ajax'
const BASE = 'http://120.55.193.14:5000'

    /*
     *获取所有用户列表   
     */
    export const reqUsers=()=>ajax(BASE+'/manage/user/list')

    /*
     *添加或更新角色
     */
    export const reqAddOrUpdateUser=(user)=>ajax(BASE+'/manage/user/'+(user._id?'update':'add'),user,'POST')

    /*
     *删除用户   
     */
    export const reqDeleteUser=(userId)=>ajax(BASE+'/manage/user/delete',{userId},'POST')

    /*
     *  添加用户接口
     */
    export function addUser(requestData) {
        return service.request({
            url:'/findPeople/addFindPeople',
            method:'post',
            params: requestData
        })
    }

    /*
     *  更新用户接口
     */
    export function updateUser(requestData) {
        return service.request({
            url:'/findPeople/updateFindPeople',
            method:'post',
            params: requestData
        })
    }
     /*
      *  删除用户接口
      */
    export function deleteUser(id) {
        return service.request({
            url:'/findPeople/deleteFindPeople',
            method:'post',
            params: id
        })
    }
    
